<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

/**
 * Class ApiResponseBodyTable 接口响应body表
 */
class ApiResponseBodyTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('api_response_body', function (Blueprint $blueprint) {
            $blueprint->increments('response_id')->comment('返回body参数id');
            $blueprint->unsignedInteger('api_id')->comment('接口id');
            $blueprint->text('body')->comment('返回参数说明');
            $blueprint->text('demo')->comment('返回参数demo');
            $blueprint->string('content_type')->comment('返回数据类型(json,xml等等)');
            $blueprint->string('remark')->comment('备注');
            $blueprint->softDeletes();
            $blueprint->timestamps();
            $blueprint->index(['api_id'], 'idx_api');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('api_response_body');
    }
}
